import matplotlib.pyplot as plt
import numpy as np

fig = plt.figure()
ax1 = fig.add_subplot(2, 2, 1)
plt.plot(np.random.randn(50).cumsum(), 'k--')
ax2 = fig.add_subplot(2, 2, 2)
data = np.arange(10)
plt.plot(data)

ax3 = fig.add_subplot(2, 2, 3)

ax3.hist(np.random.randn(100), bins=20, color='k', alpha=0.3)
ax4 = fig.add_subplot(2, 2, 4)
ax4.scatter(np.arange(30), np.arange(30) + 3 * np.random.randn(30))
